package com.twosnail.frame.job;

import com.jfinal.log.Logger;
import com.twosnail.frame.model.CouponUseLog;
import com.twosnail.frame.model.IdentifyingCode;
import com.twosnail.frame.model.XdCoupon;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Created by yangcs on 2017/7/24.
 */
public class RefundJob implements Job {

    private Logger logger = Logger.getLogger(RefundJob.class) ;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("未使用的健身劵 过期 ----开始");
        CouponUseLog.me.updateUseLogCounts();
        CouponUseLog.me.refund();
        logger.info("未使用的健身劵 过期 ----结束");

        logger.info("代金劵 过期 ----开始");
        XdCoupon.me.refund();
        logger.info("代金劵 过期 ----结束");

        logger.info("验证码 过期 ----开始");
        IdentifyingCode.me.refund();
        logger.info("验证码代金劵 过期 ----结束");
    }
}
